<template>
  <a-layout class="basic-layout">
    <!-- 顶部导航栏 -->
    <GlobalHeader />

    <!-- 主要内容区域 -->
    <a-layout-content class="main-content">
      <div class="content-wrapper">
        <RouterView />
      </div>
    </a-layout-content>

    <!-- 底部版权信息 -->
    <GlobalFooter />
  </a-layout>
</template>

<script setup lang="ts">
import { RouterView } from 'vue-router'
import GlobalHeader from '@/components/GlobalHeader.vue'
import GlobalFooter from '@/components/GlobalFooter.vue'
</script>

<style scoped>
.basic-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f5f5f5;
}

.main-content {
  flex: 1;
  padding-top: 64px; /* 为固定的 header 留出空间 */
  background: linear-gradient(180deg, #f0f8ff 0%, #f5f5f5 100%);
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
}

.content-wrapper {
  flex: 1;
  /* max-width: 1400px; */
  margin: 0 auto;
  width: 100%;
  padding: 32px 24px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  /* margin-top: 24px; */
  /* margin-bottom: 24px; */
  min-height: calc(100vh - 64px - 48px - 200px); /* 减去 header、padding 和 footer 的高度 */
  position: relative;
  overflow: hidden;
}

.content-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #1677ff 0%, #69b1ff 50%, #91caff 100%);
  border-radius: 12px 12px 0 0;
}

/* 响应式设计 */
@media (max-width: 1440px) {
  .content-wrapper {
    margin: 24px 16px;
    max-width: calc(100% - 32px);
  }
}

@media (max-width: 992px) {
  .main-content {
    background: #f5f5f5;
  }

  .content-wrapper {
    margin: 16px 12px;
    padding: 24px 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  }
}

@media (max-width: 768px) {
  .content-wrapper {
    margin: 12px 8px;
    padding: 20px 12px;
    border-radius: 6px;
    min-height: calc(100vh - 64px - 24px - 180px);
  }
}

@media (max-width: 480px) {
  .content-wrapper {
    margin: 8px 4px;
    padding: 16px 8px;
    border-radius: 4px;
  }
}
</style>
